package com.example.game.sdk.framework.plugin.channel

import com.example.game.sdk.framework.GameApiCallback
import com.example.game.sdk.framework.GameSDKInternal
import com.example.game.sdk.framework.plugin.Constants
import org.json.JSONObject

/**
 * 渠道接口
 */
object GSDKChannel {
    private val dispatcher: ChannelDispatcher =
        GameSDKInternal.getDispatcher(Constants.DISPATCHER_CHANNEL_NAME) as ChannelDispatcher


    /**
     *  登录
     * @param callback 登录回调
     */
    fun login(callback: GameApiCallback) {
        dispatcher.login(callback)
    }

    /**
     *  登出
     * @param callback 登出回调
     */
    fun logout(callback: GameApiCallback) {
        dispatcher.logout(callback)
    }

    /**
     *  支付
     * @param callback 支付回调
     */
    fun pay(params: JSONObject, callback: GameApiCallback) {
        dispatcher.pay(params, callback)
    }
}